/* styles.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #1a2980, #26d0ce);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
}

.container {
    width: 90%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

header {
    text-align: center;
    padding: 20px 0;
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    background: linear-gradient(to right, #ff9966, #ff5e62);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.8;
    max-width: 600px;
    margin: 0 auto;
}

.editor-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: #64b5f6;
}

.panel-title i {
    font-size: 1.6rem;
}

.code-editor {
    border-radius: 8px;
    overflow: hidden;
    height: 250px;
    border: 2px solid #444;
}

.controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    background: linear-gradient(to right, #3498db, #1a5f9e);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(1px);
}

.btn.run {
    background: linear-gradient(to right, #2ecc71, #27ae60);
}

.btn.clear {
    background: linear-gradient(to right, #e74c3c, #c0392b);
}

.btn.theme {
    background: linear-gradient(to right, #9b59b6, #8e44ad);
}

.output-container {
    background: rgba(0, 0, 0, 0.7);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.output {
    background: #1e1e1e;
    border-radius: 8px;
    padding: 20px;
    min-height: 150px;
    max-height: 500px;
    overflow-y: auto;
    font-family: monospace;
    white-space: pre-wrap;
    border: 2px solid #444;
    color: #f8f8f2;
    line-height: 1.6;
}

.error {
    color: #ff5555;
    font-weight: bold;
}

.success {
    color: #50fa7b;
}

.info {
    color: #8be9fd;
}

.examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.example-card {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #444;
}

.example-card:hover {
    transform: translateY(-5px);
    background: rgba(0, 0, 0, 0.8);
    border-color: #64b5f6;
}

.example-card h3 {
    color: #64b5f6;
    margin-bottom: 10px;
}

.example-card pre {
    background: rgba(30, 30, 30, 0.8);
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    color: #f1fa8c;
    font-size: 0.9rem;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 0.9rem;
    color: #aaa;
}

.database-info {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.database-info h3 {
    color: #64b5f6;
    margin-bottom: 15px;
}

.tables {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.table-card {
    background: rgba(40, 40, 40, 0.8);
    border-radius: 8px;
    padding: 15px;
}

.table-card h4 {
    color: #ff79c6;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #444;
}

.table-card ul {
    list-style-type: none;
}

.table-card li {
    padding: 3px 0;
    color: #bd93f9;
}

.table-card li span {
    color: #f1fa8c;
    display: inline-block;
    width: 80px;
}

footer {
    text-align: center;
    padding: 30px 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .code-editor {
        height: 200px;
    }
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    background: #2d2d2d;
    border-radius: 8px;
    overflow: hidden;
}

.result-table th {
    background: #444;
    color: #f8f8f2;
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid #666;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s;
}

.result-table th:hover {
    background: #555;
}

.result-table th.sorted-asc::after {
    content: ' ▲';
    font-size: 0.8em;
    color: #50fa7b;
}

.result-table th.sorted-desc::after {
    content: ' ▼';
    font-size: 0.8em;
    color: #50fa7b;
}

.result-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #444;
    color: #bd93f9;
}

.result-table tr:nth-child(even) {
    background: rgba(60, 60, 60, 0.5);
}

.result-table tr:hover {
    background: rgba(80, 80, 80, 0.7);
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 15px;
}

.pagination button {
    background: #444;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
}

.pagination button.active {
    background: #3498db;
}

.pagination button:hover:not(.active) {
    background: #555;
}

.results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding: 5px 10px;
    background: rgba(60, 60, 60, 0.5);
    border-radius: 4px;
}